﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SysModules.aspx.cs" Inherits="AiLuWeb.WebSite.WebAdmin.SysModules" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="AiLuWeb.Model" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>模块管理</title>
    <link href="/css/admin/admin.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/js/jquery.js"></script>
</head>
<body>
    <div class="titlebt">模块管理</div>
    <div>
        <!-- 前端搜索s -->
        <div class="name">
            <form action="" method="get">
            <table border="0" cellpadding="0" cellspacing="0" height="42">
                <tbody>
                    <tr>
                        <td width="10">
                            &nbsp;
                        </td>
                        <td width="100">
                            <a href="SysModuleEdit.aspx" class="butt_tle" style="width:80px"> 新建大模块 </a>
                        </td>
                    </tr>
                </tbody>
            </table>
            </form>
        </div>
        <!-- 前端搜索 e-->
        <!--显示列表s-->
        <div id="all">
            <div class="k_all3">
                <table width="100%" cellpadding="0" cellspacing="0" id="bk">
                    <tbody>
                        <tr>
                            <th width="8%">
                                模块ID
                            </th>
                            <th width="25%">
                                模块名称
                            </th>
                            <th>
                                链接页面
                            </th>
                            <th width="5%">
                                序号
                            </th>
                            <th width="20%">
                                操作
                            </th>
                        </tr>
                        <% 
                            foreach (SysModule item in sysModuleList.Where(m=> m.PId == "0"))
                            { 
                        %>
                        <tr>
                            <td>
                                <b><%=item.Id%></b>
                            </td>
                            <td>
                                <b><%=item.Name%></b>
                            </td>
                            <td>
                                <b><%=item.Href%></b>
                            </td>
                            <td>
                                <b><%=item.Sort%></b>
                            </td>
                            <td>
                                <a href="SysModuleEdit.aspx?pid=<%=item.Id%>" style="color: Black;">[新建]</a>
                                <a href="SysModuleEdit.aspx?id=<%=item.Id%>" style="color: Black;">[修改]</a>
                                <a href="javascript:;" style="color: Black;" onclick="DeleteInfo('<%=item.Id%>')">[删除]</a>
                                <a href="javascript:;" style="color: Black;" onclick="EmptyInfo('<%=item.Id%>')">[清空]</a>
                            </td>
                        </tr>
                        <%
                                foreach (SysModule info in sysModuleList.Where(m => m.PId == item.Id))
                                { 
                        %>
                        <tr>
                            <td>
                                <span>&nbsp;├ </span><%=info.Id%>
                            </td>
                            <td>
                                <span>&nbsp;&nbsp;&nbsp;&nbsp;├ </span><%=info.Name%>
                            </td>
                            <td>
                                <span>&nbsp;├ </span><%=info.Href%>
                            </td>
                            <td>
                                <span>&nbsp;├ </span><%=info.Sort%>
                            </td>
                            <td>
                                <span>&nbsp;&nbsp;&nbsp;&nbsp;├ </span>
                                <a href="SysModuleEdit.aspx?id=<%=info.Id%>" style="color: Black;">[修改]</a>
                                <a href="javascript:;" style="color: Black;" onclick="DeleteInfo('<%=info.Id%>')">[删除]</a>
                            </td>
                        </tr>
                        <% 
                                }
                            }
                        %>
                    </tbody>
                </table>
            </div>
        </div>
        <script type="text/javascript">
            function DeleteInfo(id) {
                if (id != "") {
                    if (confirm("您确定要删除吗？")) {
                        location.href = "SysModules.aspx?d=" + id;
                    }
                }
            }
            function EmptyInfo(id) {
                if (id != "") {
                    if (confirm("您确定要清空吗？")) {
                        location.href = "SysModules.aspx?e=" + id;
                    }
                }
            }
        </script>
        <!--显示列表e-->
    </div>
</body>
</html>